<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
body {
	background-image: url(pictures/RJ7LI50Y{O3PB58KE_70L3Q.png);
}
</style>
<script type="text/javascript" language="javaScript">
	function showDiv() {
		document.getElementById("search_result").style.display = "block";
		document.getElementById("content").style.display = "none";
	}
	function showFrame() {
		document.getElementById("search_result").style.display = "none";
		document.getElementById("content").style.display = "block";
	}
</script>
</head>

<body>
	<div align="right">
		<c:choose>
			<c:when test="${user != null}">
				<c:out value="Hi，${user.name}"></c:out>
				<a href="logout"> 注销</a>
			</c:when>
			<c:otherwise>
				<a href="login.jsp">登录 </a>
				<a href="register.jsp">注册</a>
			</c:otherwise>
		</c:choose>
		<c:if test="${user.admin == true }">
			<a href="admin.jsp">管理入口</a>
		</c:if>
	</div>
	<div id="div1">

		<table width=100% border="0" cellspacing="0">
			<tr>
				<td><a href="index.jsp" onClick="showFrame()"><img
						src="pictures/QQ图片20160326184653.png" width=100% height="45" /></a></td>
				<td><a href="experience.jsp" target="content"
					onClick="showFrame()"><img
						src="pictures/QQ图片20160326184451.png" width=100% height="45" /></a></td>
				<td><a href="mistake.jsp" target="content"
					onClick="showFrame()"><img
						src="pictures/QQ图片20160326184710.png" width=100% height="45" /></a></td>
				<td><a href="work_note.jsp" target="content"
					onClick="showFrame()"><img
						src="pictures/XNPLOLDXVER_{L$NMW~A@K6.png" width=100% height="45" /></a></td>
			</tr>
		</table>
		<div align="right">
			<form action="searchPaper" method="post">
				<input type="text" name="key"></input> <input type="submit"
					value="search" onClick="showDiv()"></input>
			</form>
		</div>
		<iframe name="content" width=100% height="600" id="content"
			style="display: none">
			<img src="pictures/QQ图片20160329144310.jpg" width="1079" height="600"
				align="right" />
		</iframe>
		<div id="search_result">
			<c:if test="${searchResult!=null&&fn:length(searchResult)==0}">
				抱歉，没有找到您要找的内容
			</c:if>
			<c:forEach items="${searchResult}" var="paper">
				<OL>
					<a href="${pageContext.request.contextPath}/download?fileid=${paper.id}">${paper.topic}</a>
					<div>
						Key Word:${paper.key_word}<br> 
						Summary :${paper.summary}<br>
						Time:${paper.date }&nbsp;&nbsp;Author:${paper.author} 
					</div>
				</OL>
			</c:forEach>
		</div>
	</div>
</body>
</html>
